#ifndef Context_h
#define Context_h

#include "Rules.h"
#include "Session.h"
#include "Request.h"
#include "Config.h"


class Context_T
{
public:
	// Http session
	Session_T session;

	// Http request
	Request_T request;
	Buffer_T rawEntity;
	Buffer_T rawStream;
	unsigned int entityLength;

	// Http flags
	bool isNewRequest;
	bool isEntity;

	// Http Rules
	Rules_T * rulesPtr;

	// Extension Structs
	HSE_EXEC_URL_INFO urlInfo;
	HSE_EXEC_URL_ENTITY_INFO entityInfo;
	unsigned char pbEntity[49152];

public:
	Context_T(PHTTP_FILTER_CONTEXT pFC, Rules_T * rulesPtr);
	void Reset(Rules_T * rulesPtr);

	void Send404(LPEXTENSION_CONTROL_BLOCK pECB);
	void Send404(PHTTP_FILTER_CONTEXT pFC);
};

#endif //Context_h